<?php
   echo $this->Session->flash('auth');

/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('Dasdak: the rapid development php framework:'); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');

		echo $this->Html->css('cake.generic');
                echo $this->Html->css('main');
                echo $this->Html->script('jquery');
		echo $scripts_for_layout;
	?>
</head>
<body>

    <div id="header">
    <div id="logo">
        <?php echo $this->Html->link(
					$this->Html->image('logo.png', array('alt'=> __('Socialite Event Management', true), 'border' => '0')),
					'/',
					array('target' => '_parent', 'escape' => false)
				);
			?>
    </div>

    <div id="slogan">
        <p> let's have some fun tonight! </p>
    </div>


    <div id="logout">
        <?php
         $session = $this->Session->read('account_type');
          if ($session){
              $acct_name = $session.'s';
              echo '<li>'. $this->Html->link(__('Logout', true), array('controller' => $acct_name, 'action' => 'logout')). '</li>';
          }
        ?>

    </div>
</div>
	<div id="container">

		<div id="content">
                    <?php echo $this->Session->flash(); ?>
                        <?php
                        //check account type
                        $account_type = $this->Session->read('account_type');
                        if ($account_type) {
                            switch ($account_type) {
                                case 'user':
                                    $user = $this->Session->read('user');
                                    if ($user) {
                                        echo '<div id=\'profile\'>';
                                        //echo '<h2> Information </h2>';
                                        echo '<div id="profile_pic">';

                                        if(file_exists('img/profile/user/'.$user['id'].'.jpg')){
                                            echo $this->Html->image('profile/user/'.$user['id'].'.jpg',array('height'=>'200','width'=>'235'));
                                        }else{
                                            echo $this->Html->image('default_user.jpg',array('height'=>'200','width'=>'235'));
                                        }

                                        echo '<h3 id="profile-name">';
                                        echo $user['first_name']." ".$user['last_name'];
                                        echo '</h3>';
                                        echo '</div>';


                                        echo'</div>';
                                    }
                                    break;
                                case 'host':
                                    $host = $this->Session->read('host');
                                    if ($host) {
                                        echo '<div id=\'profile\'>';
                                        //echo '<h2> Information </h2>';
                                        echo '<div id="profile_pic">';

                                        if(file_exists('img/profile/host/'.$host['id'].'.jpg')){
                                            echo $this->Html->image('profile/host/'.$host['id'].'.jpg',array('height'=>'200','width'=>'235'));
                                        }else{
                                            echo $this->Html->image('default_host.jpg',array('height'=>'200','width'=>'235'));
                                        }

                                        echo '<h3 id="profile-name">';
                                        echo $host['first_name']." ".$host['last_name'];
                                        echo '</h3>';
                                        echo '</div>';


                                        echo'</div>';
                                    }
                                    break;
                                default:
                                    echo 'No information';
                                    break;
                            }
                        }
                        ?>


			<?php echo $content_for_layout; ?>

                        </div>


		<div id="footer">
			<?php echo $this->Html->link(
					$this->Html->image('cake.power.gif', array('alt'=> __('Dasdak: the rapid development php framework', true), 'border' => '0')),
					'http://www.cakephp.org/',
					array('target' => '_blank', 'escape' => false)
				);
			?>
		</div>

		</div>
	<?php
        echo $this->element('sql_dump');

        ?>

</body>
</html>